export const getTimeFormat = (inputTime, inputFormat) => {
  const time = inputTime ? inputTime : new Date()
  const format = inputFormat ? inputFormat : 'yyyy-MM-dd'
  const year = time.getFullYear() + ''//年
  const month = time.getMonth() >= 9 ? ( time.getMonth() + 1 ) + '' : '0' + ( time.getMonth() + 1)
  const date = time.getDate() > 9 ? time.getDate() + '' : '0' + time.getDate()
  const hour = time.getHours() > 9 ? time.getHours() + '' : '0' + time.getHours()
  const minute = time.getMinutes() > 9 ? time.getMinutes() + '' : '0' + time.getMinutes()
  const second = time.getSeconds() > 9 ? time.getSeconds() + '' : '0' + time.getSeconds()
  let result = format
  result = result.replace('yyyy', year)
  result = result.replace('MM', month)
  result = result.replace('dd', date)
  result = result.replace('HH', hour)
  result = result.replace('mm', minute)
  result = result.replace('ss', second)
  return result
}